package com.guigui.erp.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.guigu.erp.pojo.ManufactureDesignProcedure;
import com.guigu.erp.service.*;
import com.guigui.erp.utils.NumberUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author Lenovo
 */
@Controller
@RequestMapping("procedure/Manufacture")
public class ManufactureManufactureController {
    @Autowired
    private NumberUtils numberUtils;
    @Autowired
    private ManufactureApplyService manufactureApplyService;
    @Autowired
    private ManufactureDesignProcedureService manufactureDesignProcedureService;
    @Autowired
    private ManufactureDesignProcedureDetailsService manufactureDesignProcedureDetailsService;
    @Autowired
    private DesignFileService designFileService;
    @Autowired
    private ManufactureDesignProcedureModuleService manufactureDesignProcedureModuleService;
    @Autowired
    private ManufactureManufactureService manufactureManufactureService;
    @Autowired
    private ManufactureProcedureService manufactureProcedureService;
    @Autowired
    private ManufactureProcedureModuleService manufactureProcedureModuleService;

    @RequestMapping("/selectOneMDesignProcedure")
    @ResponseBody
    public String selectOneMDesignProcedure(String productId) {
        QueryWrapper<ManufactureDesignProcedure> manufactureDesignProcedureQueryWrapper = new QueryWrapper<>();
        manufactureDesignProcedureQueryWrapper.eq("PRODUCT_ID", productId);
        manufactureDesignProcedureQueryWrapper.eq("CHECK_TAG", "S001-1");
        manufactureDesignProcedureQueryWrapper.eq("DESIGN_MODULE_TAG", "G002-2");
        ManufactureDesignProcedure one = manufactureDesignProcedureService.getOne(manufactureDesignProcedureQueryWrapper);
        if (one == null) {
            return "No";
        } else {
            return "Yes";
        }
    }
}
